import ddddocr


# det = ddddocr.DdddOcr(det=False, ocr=False)
#
# with open('./static/dddsite/souce1.png', 'rb') as f:
#     target_bytes = f.read()
#
# with open('./static/dddsite/souce2.png', 'rb') as f:
#     background_bytes = f.read()
#
# res = det.slide_match(target_bytes, background_bytes)
#
# print(res)

slide = ddddocr.DdddOcr(det=False, ocr=False)

with open('./static/dddsite/long1.jpg', 'rb') as f:
    target_bytes = f.read()

with open('./static/dddsite/long2.jpg', 'rb') as f:
    background_bytes = f.read()

# img = cv2.imread("bg.jpg")

res = slide.slide_comparison(target_bytes, background_bytes)

print(res)